import * as types from './mutation-types'

export default {
  // 用户登录
  login (context, payload) {
    context.commit(types.USER_LOGIN, payload)
  },
  initUser (context, payload) {
    context.commit(types.SET_USER_INFO, payloay)
  },
  updateUser (context, payload) {
    context.commit(types.UPDATE_USER_INFO, payload)
  },
  withdraw (context, payload) {
    context.commit(types.WITHDRAW, payload)
  },
  payBalance (context, payload) {
    context.commit(types.BALANCE_PAY, payload)
  },
  logout (context) {
    context.commit(types.USER_LOGOUT)
  },
  setOpenId (context, payload) {
    context.commit(types.SET_OPEN_ID, payload)
  },

  // 问题
  releaseQuestion (context, payload) {
    context.commit(types.QUESTION_RELEASE)
  },

  // 分类
  getCatalogs (context, payload) {
    context.commit(types.GET_CATALOGS, payload)
  },
  getMasterLevels (context, payload) {
    context.commit(types.GET_MASTER_LEVELS, payload)
  },

  // 回答
  setQuestionAnswer (context, payload) {
    context.commit(types.SET_QUESTION_ANSWER, payload)
  },
  removeQuestionAnswer (context, payload) {
    context.commit(types.REMOVE_QUESTION_ANSWER, payload)
  },
  saveLocalAnswer (context, payload) {
    context.commit(types.SAVE_LOCAL_ANSWER, payload)
  }
  
}
